package com.jn.algorithm.day003.question9;

/**
 * @author 江南大学1033190417
 * @date 2022/4/17 18:57
 */
public class Solution {
    public boolean isPalindrome(int x) {
        if (x < 0 || (x % 10 == 0 && x != 0))
            return false;
        int resNum = 0;
        while (x > resNum) {
            resNum = resNum * 10 + x % 10;
            x /= 10;
        }
        return x == resNum || x == resNum / 10;
    }

    public static void main(String[] args) {

    }
}
